﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Cut2One
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            var dataObject = Clipboard.GetDataObject();
            DataObject newObject = new DataObject();
            //foreach (string format in dataObject.GetFormats())
            //{
            //    Console.WriteLine(format);
            //}
            string cut = "Friendess StreamCypCut.exe";
            string one = "Friendess StreamCypOne.exe";
            if (dataObject.GetDataPresent(one))
            {
                var st = dataObject.GetData(one) as MemoryStream;
                newObject.SetData(cut, true, new MemoryStream(st.ToArray()));
                newObject.SetData(one, true, new MemoryStream(st.ToArray()));
                Clipboard.SetDataObject(newObject, true);
                Console.WriteLine("已为Cut设置剪贴板");

            }
            if (dataObject.GetDataPresent(cut))
            {
                var st = dataObject.GetData(cut) as MemoryStream;
                newObject.SetData(cut, true, new MemoryStream(st.ToArray()));
                newObject.SetData(one, true, new MemoryStream(st.ToArray()));
                Clipboard.SetDataObject(newObject, true);
                Console.WriteLine("已为One设置剪贴板");
            }
            else
            {
                Console.WriteLine("未发现剪贴板内Cut或One相关内容");
            }
            Console.WriteLine("程序结束");
            //Console.ReadKey();
        }
    }
}
